<div class="modal-dialog">
	<div class="modal-content">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		<h4 class="modal-title" id="myModalLabel">{$position_info.name}权限编辑</h4>
	</div>
	<form class="form"  action="{:U('core/user/editcontrol')}" method="post">
		<div class="modal-body form-horizontal">
			<ul class="nav nav-tabs">
				<volist name="list" id="g">
				<li class="<eq name="i" value="1">active</eq>"><a href="#{$key}" data-toggle="tab">{:C('APP_GROUP_NAME.'.strtolower($key))}</a></li>
				</volist>
			</ul>
			<div class="tab-content">
				<volist name="list" id="g">
				<div class="tab-pane <eq name="i" value="1">active</eq>" id="{$key}">
					<table class="table table-striped">
						<tbody>
							<volist name="g" id="m"  mod="2">
							<tr>
								<td align="right">{$module_name[$key]}<input type="checkbox" name="check_all"  rel="{$key}" class="check_all"/></td>
								<td width="80%">
									<volist name="m" id="a">
										{$a.name}<input type="checkbox" class="{$a.m}" name="control_arr[]" <php>if(in_array($a['control_id'], $position_info['control_ids'])){ echo 'checked="checked"';}</php>  value="{$a.control_id}"/>&nbsp;&nbsp;&nbsp;
									</volist>
								</td>
							</tr>
							</volist>
						</tbody>
					</table>
				</div>
				</volist>
			</div>
		</div>
		<div class="modal-footer">
			<input type="hidden" name="position_id" value="{$position_info.position_id}" />
			<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
			<input type="submit" class="btn btn-primary" value="保存" />
		</div>
	</form>
	</div>
</div>
<script type="text/javascript">
	$(function(){
		$(".check_all").click(function(){
			var rel = $(this).attr('rel');
			$("input[class='"+rel+"']").prop('checked', $(this).prop("checked"));
		});
	});
</script>